package com.dailyblue.example.springcloud.seata.stock.controller;

import com.dailyblue.example.springcloud.commons.util.JsonResult;
import com.dailyblue.example.springcloud.seata.stock.service.StockService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/stock")
public class StockController {
    @Resource
    private StockService service;

    @PutMapping("/{id}/{number}")
    public JsonResult update(@PathVariable String id, @PathVariable int number) {
        return service.updateStock(id, number);
    }
}
